package com.zeei.bfs.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.zeei.bfs.service.FileInfoService;
import com.zeei.bfs.vo.FileInfoVO;
import com.zeei.common.controller.BasicController;
import com.zeei.common.vo.ResultDataVO;

/**
 * Project Name:bfs
 * File Name:FileInfoController.java
 * Package Name:com.zeei.bfs.controller
 * Date:2016年12月22日下午8:38:28 Copyright (c) 2016, ZEEI All Rights Reserved. *
 *
 * ClassName:FileInfoController
 * Function: 文件上传信息调用接口
 * 
 * @author DingXiangGuang
 * @since JDK 1.8
 */
@Controller
@RequestMapping(value = "/bfs/fileinfo")
public class FileInfoController extends BasicController {

	@Autowired
	private FileInfoService fileInfoService;

	@ResponseBody
	@RequestMapping(value = "/delete", method = RequestMethod.POST)
	public ResultDataVO<String> deleteByPrimaryKey(Integer fileid) {
		Boolean flag = fileInfoService.deleteByPrimaryKey(fileid);
		return this.createResultDataVO(null, flag, null);
	}

	@ResponseBody
	@RequestMapping(value = "/insert", method = RequestMethod.POST)
	public ResultDataVO<Integer> insertSelective(FileInfoVO record) {
		boolean flag = fileInfoService.insertSelective(record);
		return this.createResultDataVO(record.getFileid(), flag, null);
	}

	@ResponseBody
	@RequestMapping(value = "/select", method = RequestMethod.POST)
	public ResultDataVO<FileInfoVO> selectByPrimaryKey(Integer fileid) {
		FileInfoVO fileInfoVO = fileInfoService.selectByPrimaryKey(fileid);
		return this.createResultDataVO(fileInfoVO, true, "");
	}
}
